<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path;
%>
<!DOCTYPE html>
<!--[if lt IE 7 ]> <html class="ie6 ie" lang="en"> <![endif]-->
<!--[if IE 7 ]>    <html class="ie7 ie" lang="en"> <![endif]-->
<!--[if IE 8 ]>    <html class="ie8 ie" lang="en"> <![endif]-->
<!--[if IE 9 ]>    <html class="ie9" lang="en"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<html lang="zh">
<!--<![endif]-->
<head>
<meta charset="UTF-8">
<title>基础资源库统一平台门户</title>
<!-- Webkit HTML5内核>双核浏览器webkit内核>双核浏览器IE内核>IE标准内核>IE兼容内核 -->
<meta name="renderer" content="webkit|ie-stand|ie-comp">
<meta name="force-rendering" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<link href="<%=basePath%>/portal/images/logo-icon.png" rel="icon">
<link rel="stylesheet" href="<%=basePath%>/portal/css/ui.css">
<link rel="stylesheet" href="<%=basePath%>/portal/css/app.css">
<script src="<%=basePath%>/portal/js/jquery-1.12.4.min.js"></script>
<script src="<%=basePath%>/portal/js/ui.js"></script>
<script src="<%=basePath%>/portal/js/app.js"></script>
<script type="text/javascript">
	if(window.top==window.self){//不存在父页面
		  
	}else{
		//TODO
		parent.location.href="http://ucpt.fhxxw.cn/Cas_Server_base/login?service=http://ucpt.fhxxw.cn/portalbase-web/login";
	}
</script>
</head>
<body>
  <div class="common-header">
    <div class="page-center">
      <!--
      <div class="common-header-user">
        <a><img class="align-middle margin-right-10" src="images/default-head.png" width="30" height="30">lihua，欢迎您！</a>
        <a>登录</a>
        <a class="vline">注销</a>
      </div>
       -->
      <a><img class="common-logo" src="<%=basePath %>/portal/images/logo@2x.png" height="47"></a>
    </div>
  </div>
  <div class="select-library">
    <div class="mo-content-index iframe-login-out">
      <div class="iframe-login">
        <h3>登录</h3>
        <form:form method="post" id="fm1" cssClass="fm-v clearfix" commandName="${commandName}" htmlEscape="true">
          <!-- <div class="cerror margin-bottom-5"> 用户名或密码不正确     </div> -->
          <form:errors path="*" cssClass="cerror margin-bottom-5" id="status" element="div" />
          <fieldset class="margin-bottom-25">
             <!-- <div class="cerror margin-bottom-5">用户名错误</div> -->
            <input type="text" id="username" name="username" class="input input-large" placeholder="请输入用户名">
          </fieldset>
          <fieldset class="margin-bottom-20">
            <!-- <div class="cerror margin-bottom-5"> 密码错误</div> -->
            <input type="password" id="password" name="password" class="input input-large" placeholder="请输入密码">
          </fieldset>
          <fieldset class="margin-bottom-25">
	            <a class="text-light on-right margin-top-5">忘记密码？</a>
	            <label class="checkbox checkbox-large">
                    <input type="checkbox" name="rememberMe" id="rememberMe" checked><i></i><span class="text-light">记住密码</span>
	            </label>
          </fieldset>
          <fieldset>
          		<input type="hidden" name="lt" value="${loginTicket}" />
				<input type="hidden" name="execution" value="${flowExecutionKey}" />
				<input type="hidden" name="_eventId" value="submit" />
				<input class="button button-blue button-larger" name="submit" accesskey="l" value="登 录" tabindex="4" type="submit" onclick="check()" />
            	<!-- <a class="button button-blue button-larger">登 录</a> -->
          </fieldset>
        </form:form>
      </div>
    </div>
  </div>  
  <div class="common-footer-thin footer-on-bottom">
    <div class="page-center">
      <p>地  址：江苏省南京市鼓楼区湖南路1号B座8楼<span class="common-span-width"></span>电话：025-83657801
        <br> Copyright 2008-2017 All Rights Reserved 江苏凤凰数字传媒有限公司 版权所有</p>
    </div>
  </div>
  <script>
      $(function () {
          var userName = getCookie("usernameCas");
          var password = getCookie("passwordCas");
          $("#username").val(userName);
          $("#password").val(password);
      });
      function check() {
          if ($("input[name='rememberMe']").is(':checked')) {
              var username = $("#username").val();
              setCookie("usernameCas", username);
              var password = $("#password").val();
              setCookie("passwordCas", password);
          } else {
              delCookie("usernameCas");
              delCookie("passwordCas");
          }
      }
      function setCookie(name,value) {
          var day = 7;
          var expires = new Date();
          expires.setTime(expires.getTime() + day * 1000 * 3600 * 24);
          document.cookie = name + "=" + escape(value) + ";path=/;expires=" + expires.toGMTString();
      }
      function getCookie(name) {
          var arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)"));
          if(arr != null)
              return unescape(arr[2]);
          return null;
      }
      function delCookie(name) {
          var cval = getCookie(name);
          if(cval != null)
              document.cookie = name + "=;path=/;expires=Fri, 02-Jan-1970 00:00:00 GMT";
      }
  </script>
</body>
</html>

